check sorting methods in c